package com.zzyk.microCloud.api.controller;

import com.zzyk.main.configuration.exception.UserException;
import com.zzyk.main.model.pojo.SysUser;
import com.zzyk.main.model.vo.Message;
import com.zzyk.main.service.MedicalReportMonthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author wss_PC
 * @DESCRIPTION 体检报告
 * @create 2020-8-5
 */
@RestController
@RequestMapping("/api/medicalReport")
public class ApiMedicalReportController extends ApiBaseController {
    @Autowired
    private MedicalReportMonthService medicalReportService;

    @GetMapping("/getMedicalReportByMonth")
    public Message getMedicalReportByMonth(String month) throws UserException {
        SysUser sysUser = getUser().getSysUser();
        return Message.success().addData("data",medicalReportService.findMedicalReportByMonth(month,  sysUser.getEnterprise(),sysUser.getDeviceList()));
    }
}